package org.agridata.akvisualization.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.agridata.akvisualization.doMain.entity.Immunity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ImmunityMapper{

    /**
     * 查询生产环境免疫信息
     * @return
     */
    @DS("second")
    List<Map<String, Object>> statisticsImmunityList();

    /**
     * 查询春防秋防数据是否重复年月、周次、类型
     * @param dates
     * @param category
     * @param cycle
     * @return
     */
    @DS("first")
    List<Immunity> selectImmunityByCategoryAndCycle(@Param("dates") String dates ,@Param("category") String category,@Param("cycle") String cycle);

    /**
     * 覆盖重复数据
     * @param brucellosisList
     */
    @DS("first")
    void deleteImmunity(@Param("list") List<Immunity> brucellosisList);

    /**
     * 导入数据
     * @param immunity
     */
    @DS("first")
    void insertImmunity(Immunity immunity);

    /**
     * 查询当年数据
     * @return
     */
    List<Immunity> selectLists();

    /**
     * 分页查询
     * @param page
     * @param category
     * @param cycle
     * @return
     */
    IPage<Immunity> selectPagess(@Param("page") IPage<Immunity> page,@Param("category") String category,@Param("cycle") Integer cycle);

    /**
     * 编辑接口
     * @param immunity
     * @return
     */
    int updateImmunity(Immunity immunity);
}
